﻿#include "Frames.h"

namespace Client::MirObjects
{

FrameSet *FrameSet::Player;
FrameSet *FrameSet::DefaultNPC;
FrameSet *FrameSet::DefaultMonster;
std::vector<FrameSet*> FrameSet::DragonStatue;
std::vector<FrameSet*> FrameSet::GreatFoxSpirit;
std::vector<FrameSet*> FrameSet::HellBomb;
std::vector<FrameSet*> FrameSet::CaveStatue;

    FrameSet::StaticConstructor::StaticConstructor()
    {
        FrameSet *frame;
        
        Player = new FrameSet();
        
        //Default NPC
        DefaultNPC = new FrameSet
        {
            {MirAction::Standing, new Frame(0, 4, 0, 450)},
            {MirAction::Harvest, new Frame(12, 10, 0, 200)}
        };
        
        //Default Monster
        DefaultMonster = new FrameSet
        {
            {MirAction::Standing, new Frame(0, 4, 0, 500)},
            {MirAction::Walking, new Frame(32, 6, 0, 100)},
            {MirAction::Attack1, new Frame(80, 6, 0, 100)},
            {MirAction::Struck, new Frame(128, 2, 0, 200)},
            {MirAction::Die, new Frame(144, 10, 0, 100)},
            {MirAction::Dead, new Frame(153, 1, 9, 1000)},
            {
                MirAction::Revive, new Frame(144, 10, 0, 100) {Reverse = true}
            }
        };
        
        #pragma region DragonStatue
        //DragonStatue 1
        DragonStatue = std::vector<FrameSet*>();
        FrameSet tempVar();
        DragonStatue.(frame = &tempVar);
        Frame tempVar2(300, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar2);
        Frame tempVar3(300, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar3);
        Frame tempVar4(300, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar4);
        
        //DragonStatue 2
        FrameSet tempVar5();
        DragonStatue.push_back(frame = &tempVar5);
        Frame tempVar6(301, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar6);
        Frame tempVar7(301, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar7);
        Frame tempVar8(301, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar8);
        
        //DragonStatue 3
        FrameSet tempVar9();
        DragonStatue.push_back(frame = &tempVar9);
        Frame tempVar10(302, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar10);
        Frame tempVar11(302, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar11);
        Frame tempVar12(302, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar12);
        
        //DragonStatue 4
        FrameSet tempVar13();
        DragonStatue.push_back(frame = &tempVar13);
        Frame tempVar14(320, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar14);
        Frame tempVar15(320, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar15);
        Frame tempVar16(320, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar16);
        
        //DragonStatue 5
        FrameSet tempVar17();
        DragonStatue.push_back(frame = &tempVar17);
        Frame tempVar18(321, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar18);
        Frame tempVar19(321, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar19);
        Frame tempVar20(321, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar20);
        
        //DragonStatue 6
        FrameSet tempVar21();
        DragonStatue.push_back(frame = &tempVar21);
        Frame tempVar22(322, 1, -1, 1000);
        frame->emplace(MirAction::Standing, &tempVar22);
        Frame tempVar23(322, 1, -1, 120);
        frame->emplace(MirAction::AttackRange1, &tempVar23);
        Frame tempVar24(322, 1, -1, 200);
        frame->emplace(MirAction::Struck, &tempVar24);
        #pragma endregion
        
        #pragma region GreatFoxSpirit
        //GreatFoxSpirit level 0
        GreatFoxSpirit = std::vector<FrameSet*>();
        FrameSet tempVar25();
        GreatFoxSpirit.(frame = &tempVar25);
        Frame tempVar26(0, 20, -20, 100);
        frame->emplace(MirAction::Standing, &tempVar26);
        Frame tempVar27(22, 8, -8, 120);
        frame->emplace(MirAction::Attack1, &tempVar27);
        Frame tempVar28(20, 2, -2, 200);
        frame->emplace(MirAction::Struck, &tempVar28);
        Frame tempVar29(300, 18, -18, 120);
        frame->emplace(MirAction::Die, &tempVar29);
        Frame tempVar30(317, 1, -1, 1000);
        frame->emplace(MirAction::Dead, &tempVar30);
        Frame *tempVar31 = new Frame(300, 18, -18, 150);
        tempVar31->Reverse = true;
        frame->emplace(MirAction::Revive, tempVar31);
        
        //GreatFoxSpirit level 1
        FrameSet tempVar32();
        GreatFoxSpirit.push_back(frame = &tempVar32);
        Frame tempVar33(60, 20, -20, 100);
        frame->emplace(MirAction::Standing, &tempVar33);
        Frame tempVar34(82, 8, -8, 120);
        frame->emplace(MirAction::Attack1, &tempVar34);
        Frame tempVar35(80, 2, -2, 200);
        frame->emplace(MirAction::Struck, &tempVar35);
        Frame tempVar36(300, 18, -18, 120);
        frame->emplace(MirAction::Die, &tempVar36);
        Frame tempVar37(317, 1, -1, 1000);
        frame->emplace(MirAction::Dead, &tempVar37);
        Frame *tempVar38 = new Frame(300, 18, -18, 150);
        tempVar38->Reverse = true;
        frame->emplace(MirAction::Revive, tempVar38);
        
        //GreatFoxSpirit level 2
        FrameSet tempVar39();
        GreatFoxSpirit.push_back(frame = &tempVar39);
        Frame tempVar40(120, 20, -20, 100);
        frame->emplace(MirAction::Standing, &tempVar40);
        Frame tempVar41(142, 8, -8, 120);
        frame->emplace(MirAction::Attack1, &tempVar41);
        Frame tempVar42(140, 2, -2, 200);
        frame->emplace(MirAction::Struck, &tempVar42);
        Frame tempVar43(300, 18, -18, 120);
        frame->emplace(MirAction::Die, &tempVar43);
        Frame tempVar44(317, 1, -1, 1000);
        frame->emplace(MirAction::Dead, &tempVar44);
        Frame *tempVar45 = new Frame(300, 18, -18, 150);
        tempVar45->Reverse = true;
        frame->emplace(MirAction::Revive, tempVar45);
        
        //GreatFoxSpirit level 3
        FrameSet tempVar46();
        GreatFoxSpirit.push_back(frame = &tempVar46);
        Frame tempVar47(180, 20, -20, 100);
        frame->emplace(MirAction::Standing, &tempVar47);
        Frame tempVar48(202, 8, -8, 120);
        frame->emplace(MirAction::Attack1, &tempVar48);
        Frame tempVar49(200, 2, -2, 200);
        frame->emplace(MirAction::Struck, &tempVar49);
        Frame tempVar50(300, 18, -18, 120);
        frame->emplace(MirAction::Die, &tempVar50);
        Frame tempVar51(317, 1, -1, 1000);
        frame->emplace(MirAction::Dead, &tempVar51);
        Frame *tempVar52 = new Frame(300, 18, -18, 150);
        tempVar52->Reverse = true;
        frame->emplace(MirAction::Revive, tempVar52);
        
        //GreatFoxSpirit level 4
        FrameSet tempVar53();
        GreatFoxSpirit.push_back(frame = &tempVar53);
        Frame tempVar54(240, 20, -20, 100);
        frame->emplace(MirAction::Standing, &tempVar54);
        Frame tempVar55(262, 8, -8, 120);
        frame->emplace(MirAction::Attack1, &tempVar55);
        Frame tempVar56(260, 2, -2, 200);
        frame->emplace(MirAction::Struck, &tempVar56);
        Frame tempVar57(300, 18, -18, 120);
        frame->emplace(MirAction::Die, &tempVar57);
        Frame tempVar58(317, 1, -1, 1000);
        frame->emplace(MirAction::Dead, &tempVar58);
        Frame *tempVar59 = new Frame(300, 18, -18, 150);
        tempVar59->Reverse = true;
        frame->emplace(MirAction::Revive, tempVar59);
        #pragma endregion
        
        #pragma region HellBombs
        //HellBomb1
        HellBomb = std::vector<FrameSet*>();
        FrameSet tempVar60();
        HellBomb.(frame = &tempVar60);
        Frame *tempVar61 = new Frame(52, 9, -9, 100);
        tempVar61->Blend = true;
        frame->emplace(MirAction::Standing, tempVar61);
        Frame *tempVar62 = new Frame(999, 1, -1, 120);
        tempVar62->Blend = true;
        frame->emplace(MirAction::Attack1, tempVar62);
        Frame *tempVar63 = new Frame(52, 9, -9, 100);
        tempVar63->Blend = true;
        frame->emplace(MirAction::Struck, tempVar63);
        
        //HellBomb2
        FrameSet tempVar64();
        HellBomb.push_back(frame = &tempVar64);
        Frame *tempVar65 = new Frame(70, 9, -9, 100);
        tempVar65->Blend = true;
        frame->emplace(MirAction::Standing, tempVar65);
        Frame *tempVar66 = new Frame(999, 1, -1, 120);
        tempVar66->Blend = true;
        frame->emplace(MirAction::Attack1, tempVar66);
        Frame *tempVar67 = new Frame(70, 9, -9, 100);
        tempVar67->Blend = true;
        frame->emplace(MirAction::Struck, tempVar67);
        
        //HellBomb3
        FrameSet tempVar68();
        HellBomb.push_back(frame = &tempVar68);
        Frame *tempVar69 = new Frame(88, 9, -9, 100);
        tempVar69->Blend = true;
        frame->emplace(MirAction::Standing, tempVar69);
        Frame *tempVar70 = new Frame(999, 1, -1, 120);
        tempVar70->Blend = true;
        frame->emplace(MirAction::Attack1, tempVar70);
        Frame *tempVar71 = new Frame(88, 9, -9, 100);
        tempVar71->Blend = true;
        frame->emplace(MirAction::Struck, tempVar71);
        #pragma endregion
        
        #pragma region CaveStatues
        //CaveStatue1
        CaveStatue = std::vector<FrameSet*>();
        FrameSet tempVar72();
        CaveStatue.(frame = &tempVar72);
        Frame *tempVar73 = new Frame(0, 1, -1, 100);
        tempVar73->Blend = false;
        frame->emplace(MirAction::Standing, tempVar73);
        Frame *tempVar74 = new Frame(0, 1, -1, 100);
        tempVar74->Blend = false;
        frame->emplace(MirAction::Struck, tempVar74);
        Frame *tempVar75 = new Frame(2, 8, -8, 100);
        tempVar75->Blend = false;
        frame->emplace(MirAction::Die, tempVar75);
        Frame *tempVar76 = new Frame(9, 1, -1, 100);
        tempVar76->Blend = false;
        frame->emplace(MirAction::Dead, tempVar76);
        
        //CaveStatue2
        FrameSet tempVar77();
        CaveStatue.push_back(frame = &tempVar77);
        Frame *tempVar78 = new Frame(18, 1, -1, 100);
        tempVar78->Blend = false;
        frame->emplace(MirAction::Standing, tempVar78);
        Frame *tempVar79 = new Frame(18, 1, -1, 100);
        tempVar79->Blend = false;
        frame->emplace(MirAction::Struck, tempVar79);
        Frame *tempVar80 = new Frame(20, 8, -8, 100);
        tempVar80->Blend = false;
        frame->emplace(MirAction::Die, tempVar80);
        Frame *tempVar81 = new Frame(27, 1, -1, 100);
        tempVar81->Blend = false;
        frame->emplace(MirAction::Dead, tempVar81);
        #pragma endregion
        
        #pragma region Player
        //Common
        Frame tempVar82(0, 4, 0, 500, 0, 8, 0, 250);
        Player->emplace(MirAction::Standing, &tempVar82);
        Frame tempVar83(32, 6, 0, 100, 64, 6, 0, 100);
        Player->emplace(MirAction::Walking, &tempVar83);
        Frame tempVar84(80, 6, 0, 100, 112, 6, 0, 100);
        Player->emplace(MirAction::Running, &tempVar84);
        Frame tempVar85(128, 1, 0, 1000, 160, 1, 0, 1000);
        Player->emplace(MirAction::Stance, &tempVar85);
        Frame tempVar86(300, 1, 5, 1000, 332, 1, 5, 1000);
        Player->emplace(MirAction::Stance2, &tempVar86);
        Frame tempVar87(136, 6, 0, 100, 168, 6, 0, 100);
        Player->emplace(MirAction::Attack1, &tempVar87);
        Frame tempVar88(184, 6, 0, 100, 216, 6, 0, 100);
        Player->emplace(MirAction::Attack2, &tempVar88);
        Frame tempVar89(232, 8, 0, 100, 264, 8, 0, 100);
        Player->emplace(MirAction::Attack3, &tempVar89);
        Frame tempVar90(416, 6, 0, 100, 448, 6, 0, 100);
        Player->emplace(MirAction::Attack4, &tempVar90);
        Frame tempVar91(296, 6, 0, 100, 328, 6, 0, 100);
        Player->emplace(MirAction::Spell, &tempVar91);
        Frame tempVar92(344, 2, 0, 300, 376, 2, 0, 300);
        Player->emplace(MirAction::Harvest, &tempVar92);
        Frame tempVar93(360, 3, 0, 100, 392, 3, 0, 100);
        Player->emplace(MirAction::Struck, &tempVar93);
        Frame tempVar94(384, 4, 0, 100, 416, 4, 0, 100);
        Player->emplace(MirAction::Die, &tempVar94);
        Frame tempVar95(387, 1, 3, 1000, 419, 1, 3, 1000);
        Player->emplace(MirAction::Dead, &tempVar95);
        Frame *tempVar96 = new Frame(384, 4, 0, 100, 416, 4, 0, 100);
        tempVar96->Reverse = true;
        Player->emplace(MirAction::Revive, tempVar96);
        Frame tempVar97(184, 6, 0, 100, 216, 6, 0, 100);
        Player->emplace(MirAction::Mine, &tempVar97);
        Frame tempVar98(139, 1, 5, 1000, 300, 1, 5, 1000);
        Player->emplace(MirAction::Lunge, &tempVar98);
        
        //Assassin
        Frame tempVar99(464, 6, 0, 100, 496, 6, 0, 100);
        Player->emplace(MirAction::Sneek, &tempVar99);
        Frame tempVar100(80, 3, 3, 100, 112, 3, 3, 100);
        Player->emplace(MirAction::DashAttack, &tempVar100);
        
        //Archer
        Frame tempVar101(0, 6, 0, 100, 0, 6, 0, 100);
        Player->emplace(MirAction::WalkingBow, &tempVar101);
        Frame tempVar102(48, 6, 0, 100, 48, 6, 0, 100);
        Player->emplace(MirAction::RunningBow, &tempVar102);
        Frame tempVar103(96, 8, 0, 100, 96, 8, 0, 100);
        Player->emplace(MirAction::AttackRange1, &tempVar103);
        Frame tempVar104(160, 8, 0, 100, 160, 8, 0, 100);
        Player->emplace(MirAction::AttackRange2, &tempVar104);
        Frame tempVar105(224, 8, 0, 100, 224, 8, 0, 100);
        Player->emplace(MirAction::AttackRange3, &tempVar105);
        Frame tempVar106(288, 8, 0, 100, 288, 8, 0, 100);
        Player->emplace(MirAction::Jump, &tempVar106);
        
        //Mounts
        Frame tempVar107(416, 4, 0, 500, 448, 4, 0, 500);
        Player->emplace(MirAction::MountStanding, &tempVar107);
        Frame tempVar108(448, 8, 0, 100, 480, 8, 0, 500);
        Player->emplace(MirAction::MountWalking, &tempVar108);
        Frame tempVar109(512, 6, 0, 100, 544, 6, 0, 100);
        Player->emplace(MirAction::MountRunning, &tempVar109);
        Frame tempVar110(560, 3, 0, 100, 592, 3, 0, 100);
        Player->emplace(MirAction::MountStruck, &tempVar110);
        Frame tempVar111(584, 6, 0, 100, 616, 6, 0, 100);
        Player->emplace(MirAction::MountAttack, &tempVar111);
        
        //Fishing
        Frame tempVar112(632, 8, 0, 100);
        Player->emplace(MirAction::FishingCast, &tempVar112);
        Frame tempVar113(696, 6, 0, 120);
        Player->emplace(MirAction::FishingWait, &tempVar113);
        Frame tempVar114(744, 8, 0, 100);
        Player->emplace(MirAction::FishingReel, &tempVar114);
        
        #pragma endregion

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar96' statement was not added since tempVar96 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar81' statement was not added since tempVar81 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar80' statement was not added since tempVar80 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar79' statement was not added since tempVar79 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar78' statement was not added since tempVar78 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar76' statement was not added since tempVar76 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar75' statement was not added since tempVar75 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar74' statement was not added since tempVar74 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar73' statement was not added since tempVar73 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar71' statement was not added since tempVar71 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar70' statement was not added since tempVar70 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar69' statement was not added since tempVar69 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar67' statement was not added since tempVar67 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar66' statement was not added since tempVar66 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar65' statement was not added since tempVar65 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar63' statement was not added since tempVar63 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar62' statement was not added since tempVar62 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar61' statement was not added since tempVar61 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar59' statement was not added since tempVar59 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar52' statement was not added since tempVar52 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar45' statement was not added since tempVar45 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar38' statement was not added since tempVar38 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar31' statement was not added since tempVar31 was passed to a method or constructor. Handle memory management manually.
    }

FrameSet::StaticConstructor FrameSet::staticConstructor;

    int Frame::getOffSet() const
    {
        return Count + Skip;
    }

    int Frame::getEffectOffSet() const
    {
        return EffectCount + EffectSkip;
    }

    Frame::Frame(int start, int count, int skip, int interval, int effectstart, int effectcount, int effectskip, int effectinterval)
    {
        Start = start;
        Count = count;
        Skip = skip;
        Interval = interval;
        EffectStart = effectstart;
        EffectCount = effectcount;
        EffectSkip = effectskip;
        EffectInterval = effectinterval;
    }

    Frame::Frame(BinaryReader *reader)
    {
        Start = reader->ReadInt32();
        Count = reader->ReadInt32();
        Skip = reader->ReadInt32();
        Interval = reader->ReadInt32();
        EffectStart = reader->ReadInt32();
        EffectCount = reader->ReadInt32();
        EffectSkip = reader->ReadInt32();
        EffectInterval = reader->ReadInt32();
        Reverse = reader->ReadBoolean();
        Blend = reader->ReadBoolean();
    }
}
